<template>
  <div
    class="btn"
    @click="handlerClick"
    :class="{ primay: type == 'primay', waring: type == 'warning' }"
  >
    <!-- //匿名插槽 -->
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: ["type"],
  methods: {
    handlerClick(e) {
      this.$emit("click", e);
    },
  },
};
</script>

<style lang="less" scoped>
.btn {
  width: 320 * 100vw/360;
  height: 50px;
  background-color: rgb(27, 12, 158);
  border-radius: 25px;
  line-height: 50px;
  text-align: center;
  color: #fff;
  font-weight: bold;
  font-size: 20px;
}
.primay {
  background-color: rgb(19, 238, 161);
  color: #fff;
}

.warning {
  background-color: rgb(242, 145, 0);
  color: #fff;
}
</style>